package ch03_oothinking.finallyuse;

import java.io.*;

/**
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class FinallyUse {
    public static void main(String[] args) {
        File file = new File("d:/test.txt");
        InputStream inputStream = null;
        try {
            inputStream = new FileInputStream(file);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } finally {
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
